package com.wink.admin.common.event;


import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;


/**
 * 演示监听听器
 *
 * @author wink
 * @date 2020/11/16 14:30:27
 */
@Slf4j
@Component
public class DemoListener {


    /**
     * 测试spring事件
     *
     * @param event 事件
     */
    @Async
    @EventListener(DemoApplicationEvent.class)
    public void testSpringEvent(DemoApplicationEvent event) {
        String source = (String) event.getSource();
        log.warn("监听到演示事件：{},ThreadName:{}", source, Thread.currentThread().getName());
    }

}
